package com.shop.dao.implement;

import java.util.List;

import org.springframework.orm.hibernate3.HibernateTemplate;

import com.shop.dao.HibernateBaseDao;
import com.shop.dao.ISortDao;
import com.shop.pojo.Sort;

public class SortDao extends HibernateBaseDao<Sort> implements ISortDao {
	
	@SuppressWarnings("unchecked")
	public List<Sort> findFirstClassify(){
		String hql = "from Sort s where s.parentSort is null";
		HibernateTemplate ht= getHibernateTemplate();
		ht.setCacheQueries(true);
		ht.setQueryCacheRegion("sortquery");
		return ht.find(hql);
	}
	public List<Sort> findAll(){
		return findAll("sortquery");
	}


}
